<?php

namespace Common\Model;

class MessageModel extends CommonModel {
	protected $_validate = array (
		array('msg_content','require','请输入消息内容'),
		array('msg_content','1,60','消息内容限制60字以内',0,'length'),
	);
	
	protected $_link = array (
		'member' => array (
			'mapping_type' => self::HAS_ONE,
			'class_name' => 'Member',
			'mapping_key' => 'fromuser',
			'foreign_key' => 'fromuser',
			'mapping_fields' => 'nickname,headimgurl',
			'as_fields' => 'nickname,headimgurl' 
		) 
	);
}